<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ include file="login/include.jsp"%>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> 

<html>
  <head>    
    <title>starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<style>
#csp_login{
	margin-left: 5px;
	padding: 0px;
	float: right;
}

#csp_register {
	margin-left: 20px;
	padding: 0px;
}

form {
	height: 430px;
}

#csp_login,#csp_login-top,#csp_login-bottom {
	width: 300px;
	text-align: center;
	float: left;
}

#csp_register,#csp_register-top,#csp_register-bottom {
	width: 500px;
	float: right;
}

#csp_login-top,#csp_register-top {
	position: relative;
	top: -3px;
	margin-top: 0px;
}

#csp_login-bottom,#csp_register-bottom {
	position: relative;
	top: 10px;
	margin-bottom: 0px;
}

#csp_login h3,#csp_register h3 {
	margin-top: 0px;
	background: none;
	border: none;
}

.csp_table-form th {
	padding-right: 0.5em;
}

th,td {
	padding-top: 2px;
	padding-bottom;
	2
	px;
	
}

#csp_login .csp_table-form td.errorMessage {
	padding-bottom: 1em;
}
</style>
<script type="text/javascript">
$(document).ready(function() { 
		//login part	    
	    $.formValidator.initConfig({formID:"loginForm",
		onError:function(msg,obj,errorlist){
			$("#errorlist").empty();
			$.map(errorlist,function(msg){
				$("#errorlist").append("<li><font color="+"red"+"> " + msg + "</font></li>")
			});
		},
		submitAfterAjaxPrompt : 'Validating! Please wait...'
	});
	$("#loginEmail").formValidator({onShow:"Please Enter an Username",onFocus:"Username should be an Email",onCorrect:"Correct Username Format"}).inputValidator({min:1,onError:"Please Enter a Username"}).regexValidator({regExp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onError:"Username need to be a Email"});

	//register part
	$.formValidator.initConfig({validatorGroup:"2",formID:"registerForm", submitButtonID:"register",
			onError:function(msg,obj,errorlist2){
						$("#errorlist2").empty();
			$.map(errorlist2,function(msg){
				$("#errorlist2").append("<li><font color="+"red"+"> " + msg + "</font></li>")
			});
		},
		submitAfterAjaxPrompt : 'Validating! Please wait...'			
	});
	
	$("#email").formValidator({validatorGroup:"2",onShow:"Please Enter an Email",onFocus:"Please Enter an Email",onCorrect:"Correct Username Format"}).inputValidator({min:1,onError:"Username can't be Empty"}).regexValidator({regExp:"^([\\w-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([\\w-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$",onError:"Please Enter an Email"})
			.ajaxValidator({
					dataType : "post",
					async : true,
					url :"${validateDup}",
					success : function(data){
						if(data == 'true') return true;
//			            if( data.equals(false)) return false;
						return false;
					},
					buttons: $("#button"),
					error: function(jqXHR, textStatus, errorThrown){alert("Server not Responding，please try again"+errorThrown);},
					onError : "User Already Exists",
					onWait : "Validating! Please wait.."
			});
	
	$("#pass").formValidator({validatorGroup:"2",onShow:"Please enter password",onFocus:"Typing..",onCorrect:"Password Typed"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"Wrong Password Format"},onError:"Password can't be Empty"});
	$("#confirmPass").formValidator({validatorGroup:"2",onShow:"please confirm password",onFocus:"Typing",onCorrect:"Password Confirmed"}).inputValidator({min:1,empty:{leftEmpty:false,rightEmpty:false,emptyError:"Wrong Password Format"},onError:"Password can't be Empty"}).compareValidator({desID:"pass",operateor:"=",onError:"Unmatched Password"});
	$("#fname").formValidator({validatorGroup:"2",onShow:"Please Enter Your First Name",onFocus:"Typing",onCorrect:"\b"}).inputValidator({min:1,onError:"Please Enter your First Name"});
	$("#mname").formValidator({validatorGroup:"2",onShow:"optional",onFocus:"Typing",onCorrect:"\b"}).inputValidator({min:0,onError:"\b"});
	$("#lname").formValidator({validatorGroup:"2",onShow:"Please Enter Your Last Name",onFocus:"Typing",onCorrect:"\b"}).inputValidator({min:1,onError:"Please Enter your Last Name"});
	$("#contact").formValidator({validatorGroup:"2",onShow:"optional",onFocus:"Typing",onCorrect:"\b"}).inputValidator({min:0,onError:"\b"});
	$("#unit").formValidator({validatorGroup:"2",onShow:"optional",onFocus:"Typing",onCorrect:"\b"}).inputValidator({min:0,onError:"\b"});
	$("#position").formValidator({validatorGroup:"2",onShow:"optional",onFocus:"Typing",onCorrect:"\b"}).inputValidator({min:0,onError:"\b"});

	});
	
</script>



 </head>
  
 <body> 

<h3>
This will be the login page or Home Page later!!!
</h3>
<html:form action="/startupload">
<input type="submit" value="Start Uploading file" name="start">
</html:form>




    
  </body>
</html>